home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / mobile / fma-2.0-stable-setup.exe / {app} / sframework / plugins / WinDVD.vbs < prev    next >
Encoding:
Text File  |  2004-09-09  |  5.2 KB  |  217 lines

  1. 'FMA Script Framework Plugin
  2. 'WinDVD
  3. 'Lets you control Intervideo WinDVD
  4.  
  5. 'TODO:
  6. '-Testing
  7. '-Maybe implement DVD Menu with joystick instead of menu items
  8.  
  9. Class WinDVD
  10.     
  11.     Private m_Self
  12.     Private mainMenu
  13.     
  14.     'Some info about the plugin
  15.     Public Property Get SHOWABLE 'Do I have a menu?
  16.         SHOWABLE    = True
  17.     End Property
  18.     Public Property Get TITLE 'What's my name?
  19.         TITLE       = "WinDVD"
  20.     End Property
  21.     Public Property Get DESCRIPTION 'What's my purpose?
  22.         DESCRIPTION = "Lets you control Intervideo WinDVD"
  23.     End Property
  24.     Public Property Get AUTHOR 'Who created me?
  25.         AUTHOR      = "streawkceur"
  26.     End Property
  27.     Public Property Get URL 'Were can I be found? Where can you get more information?
  28.         URL = "http://fma.xinium.com/"
  29.     End Property
  30.     
  31.     'Who am I?
  32.     Public Property Let Self (s)
  33.         m_Self = s
  34.         ' Some init stuff here:
  35.         If IsEmpty(Settings(Me, "Title")) or Settings(Me, "Title") = "" Then Settings(Me, "Title") = "Intervideo WinDVD"
  36.         If IsEmpty(Settings(Me, "Exe"))   or Settings(Me, "Exe")   = "" Then Settings(Me, "Exe")   = "C:\Program Files\InterVideo\DVD5\WinDVD.exe"
  37.         Set mainMenu = New ManagedMenu
  38.         mainMenu.Title = TITLE
  39.     End Property
  40.     Public Property Get Self
  41.         Self = m_Self
  42.     End Property
  43.     
  44.     'Display me. Eventually put a menu on the screen
  45.     Sub Show()
  46.         '--> Init Menu
  47.         Dim llist
  48.         Set llist = New LinkedList
  49.         Dim bi
  50.         bi = llist.BackInserter
  51.         If WDVDOpen Then
  52.             bi.Item = Array("Play",          Self & ".Play")
  53.             bi.Item = Array("Pause/Resume",  Self & ".Pause")
  54.             bi.Item = Array("Stop",          Self & ".Stopp")
  55.             bi.Item = Array("Prev Chapter",  Self & ".PrevChapter")
  56.             bi.Item = Array("Next Chapter",  Self & ".NextChapter")
  57.             bi.Item = Array("Audio Stream",  Self & ".AudioStream")
  58.             bi.Item = Array("Volume +",      Self & ".VolumeUp")
  59.             bi.Item = Array("Volume -",      Self & ".VolumeDn")
  60.             bi.Item = Array("(Un)Mute",      Self & ".VolumeMute")
  61.             bi.Item = Array("?SubTitles",    Self & ".SubTitles")
  62.             bi.Item = Array("Fullscreen",    Self & ".Fullscreen")
  63.             bi.Item = Array("Step Backward", Self & ".StepBwd")
  64.             bi.Item = Array("Step Forward",  Self & ".StepFwd")
  65.             bi.Item = Array("Speed +",       Self & ".SpeedUp")
  66.             bi.Item = Array("Speed -",       Self & ".SpeedDn")
  67.             bi.Item = Array("Step Forward",  Self & ".StepFwd")
  68.             bi.Item = Array("Capture Frame", Self & ".CaptureFrame")
  69.             bi.Item = Array("DVD Menu",      Self & ".DVDMenu")
  70.             bi.Item = Array("Select",        Self & ".MenuSelect")
  71.             bi.Item = Array("Up",            Self & ".Up")
  72.             bi.Item = Array("Down",          Self & ".Down")
  73.             bi.Item = Array("Left",          Self & ".Left")
  74.             bi.Item = Array("Right",         Self & ".Right")
  75.             bi.Item = Array("Close",         Self & ".Close")
  76.         Else
  77.             bi.Item = Array("Launch",        Self & ".Launch")
  78.         End If
  79.         mainMenu.SetList llist
  80.         mainMenu.ShowMenu
  81.     End Sub
  82.     
  83.     Function WDVDOpen
  84.         WDVDOpen = Shell.AppActivate(Settings(Me, "Title"))
  85.     End Function
  86.     
  87.     Sub Launch
  88.         If Fso.FileExists(Settings(Me, "Exe")) Then
  89.             Shell.Exec Settings(Me, "Exe")
  90.             Util.WaitForAppLoad Settings(Me, "Title"), 10000 'Give WDVD max. 10 secs to load
  91.         Else
  92.             Debug.ErrorMsg Self & " - Launch: File not found: " & Settings(Me, "Exe")
  93.         End If
  94.         Show
  95.     End Sub
  96.     
  97.     Sub Close
  98.         If WDVDOpen Then
  99.             Shell.SendKeys "%{F4}"
  100.             Util.Sleep 3000 'Give WDVD 3secs to close itself
  101.         End If
  102.         Show
  103.     End Sub
  104.     
  105.     Sub Play
  106.         If WDVDOpen Then Shell.SendKeys "^p"
  107.         am.Update
  108.     End Sub
  109.     
  110.     Sub Pause
  111.         If WDVDOpen Then Shell.SendKeys "{ }"
  112.         am.Update
  113.     End Sub
  114.     
  115.     Sub Stopp
  116.         If WDVDOpen Then Shell.SendKeys "{END}"
  117.         am.Update
  118.     End Sub
  119.     
  120.     Sub PrevChapter
  121.         If WDVDOpen Then Shell.SendKeys "{PGUP}"
  122.         am.Update
  123.     End Sub
  124.     
  125.     Sub NextChapter
  126.         If WDVDOpen Then Shell.SendKeys "{PGDN}"
  127.         am.Update
  128.     End Sub
  129.     
  130.     Sub AudioStream
  131.         If WDVDOpen Then Shell.SendKeys "a"
  132.         am.Update
  133.     End Sub
  134.     
  135.     Sub VolumeUp
  136.         If WDVDOpen Then Shell.SendKeys "+{UP}"
  137.         am.Update
  138.     End Sub
  139.     
  140.     Sub VolumeDn
  141.         If WDVDOpen Then Shell.SendKeys "+{DOWN}"
  142.         am.Update
  143.     End Sub
  144.     
  145.     Sub VolumeMute
  146.         If WDVDOpen Then Shell.SendKeys "m"
  147.         am.Update
  148.     End Sub
  149.     
  150.     Sub SubTitles
  151.         If WDVDOpen Then Shell.SendKeys "s"
  152.         am.Update
  153.     End Sub
  154.     
  155.     Sub Fullscreen
  156.         If WDVDOpen Then Shell.SendKeys "z"
  157.         am.Update
  158.     End Sub
  159.     
  160.     Sub SpeedUp
  161.         If WDVDOpen Then Shell.SendKeys "^{RIGHT}"
  162.         am.Update
  163.     End Sub
  164.     
  165.     Sub SpeedDn
  166.         If WDVDOpen Then Shell.SendKeys "^{LEFT}"
  167.         am.Update
  168.     End Sub
  169.     
  170.     Sub StepBwd
  171.         If WDVDOpen Then Shell.SendKeys "^n"
  172.         am.Update
  173.     End Sub
  174.     
  175.     Sub StepFwd
  176.         If WDVDOpen Then Shell.SendKeys "n"
  177.         am.Update
  178.     End Sub
  179.     
  180.     Sub CaptureFrame
  181.         If WDVDOpen Then Shell.SendKeys "p"
  182.         am.Update
  183.     End Sub
  184.     
  185.     Sub DVDMenu
  186.         If WDVDOpen Then shell.SendKeys "^m"
  187.         am.Update
  188.     End Sub
  189.     
  190.     Sub MenuSelect
  191.         If WDVDOpen Then shell.SendKeys "~"
  192.         am.Update
  193.     End Sub
  194.     
  195.     Sub Up
  196.         If WDVDOpen Then shell.SendKeys "{UP}"
  197.         am.Update
  198.     End Sub
  199.     
  200.     Sub Down
  201.         If WDVDOpen Then shell.SendKeys "{DOWN}"
  202.         am.Update
  203.     End Sub
  204.     
  205.     Sub Left
  206.         If WDVDOpen Then shell.SendKeys "{LEFT}"
  207.         am.Update
  208.     End Sub
  209.     
  210.     Sub Right
  211.         If WDVDOpen Then shell.SendKeys "{RIGHT}"
  212.         am.Update
  213.     End Sub
  214.     
  215. End Class
  216.  
  217.